package cn.iocoder.yudao.module.handguard.dal.mysql.userbasetable4;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable4.UserBaseTable4DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.handguard.controller.app.userbasetable4.vo.*;

/**
 * 工薪贷 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserBaseTable4Mapper extends BaseMapperX<UserBaseTable4DO> {

    default PageResult<UserBaseTable4DO> selectPage(UserBaseTable4PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserBaseTable4DO>()
                .eqIfPresent(UserBaseTable4DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable4DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable4DO::getOfficeHours, reqVO.getOfficeHours())
                .eqIfPresent(UserBaseTable4DO::getIsPunchPay, reqVO.getIsPunchPay())
                .eqIfPresent(UserBaseTable4DO::getIsSocialSecurity, reqVO.getIsSocialSecurity())
                .eqIfPresent(UserBaseTable4DO::getIsAccumulationFund, reqVO.getIsAccumulationFund())
                .eqIfPresent(UserBaseTable4DO::getIsBd, reqVO.getIsBd())
                .eqIfPresent(UserBaseTable4DO::getIsCar, reqVO.getIsCar())
                .betweenIfPresent(UserBaseTable4DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable4DO::getId));
    }

    default List<UserBaseTable4DO> selectList(UserBaseTable4ExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<UserBaseTable4DO>()
                .eqIfPresent(UserBaseTable4DO::getUserId, reqVO.getUserId())
                .eqIfPresent(UserBaseTable4DO::getNatureOfUnit, reqVO.getNatureOfUnit())
                .eqIfPresent(UserBaseTable4DO::getOfficeHours, reqVO.getOfficeHours())
                .eqIfPresent(UserBaseTable4DO::getIsPunchPay, reqVO.getIsPunchPay())
                .eqIfPresent(UserBaseTable4DO::getIsSocialSecurity, reqVO.getIsSocialSecurity())
                .eqIfPresent(UserBaseTable4DO::getIsAccumulationFund, reqVO.getIsAccumulationFund())
                .eqIfPresent(UserBaseTable4DO::getIsBd, reqVO.getIsBd())
                .eqIfPresent(UserBaseTable4DO::getIsCar, reqVO.getIsCar())
                .betweenIfPresent(UserBaseTable4DO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(UserBaseTable4DO::getId));
    }

}
